package sql;

public class GetSql {

    public static String selectTableColumnSql(String dbName, String tableName) {
        return "SELECT column_name, column_type, column_comment,is_nullable " +
                "FROM information_schema.columns " +
                "WHERE table_schema = '" + dbName + "' " +
                "AND table_name = '" + tableName + "' limit 0,1000; ";
    }

    public static String selectTablePRISql(String dbName, String tableName) {
        return "SELECT COLUMN_NAME " +
                "FROM INFORMATION_SCHEMA.COLUMNS " +
                "WHERE TABLE_SCHEMA = '" + dbName + "' and TABLE_NAME = '" + tableName + "' " +
                "AND EXTRA = 'auto_increment';";
    }

    public static void main(String[] args) {
        System.out.println(selectTablePRISql("test", "test"));
    }

}
